package com.company;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.util.stream.Collectors;

/**
 * @author Administrator
 */

public class HJ14字符串排序 {

    public static void main(String[] args) {
        List<String> stringList = new ArrayList<>();
        Scanner scanner = new Scanner(System.in);
        int inputInt = scanner.nextInt();
        for (int i = 0; i < inputInt; i++) {
            String inputString = scanner.next();
            stringList.add(inputString);
        }
        List<String> list = stringList.stream().sorted().collect(Collectors.toList());
        System.out.println(list.stream().map(Object::toString).collect(Collectors.joining("\n")));
    }
}
